﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Web.UI.WebControls;
using System.Web.UI;
using System.ComponentModel;

namespace Kevin.Controls
{
    [Serializable]
    [ToolboxItem(false)]
    [ToolboxData("<{0}:Parameter runat=\"server\" />")]
    public class Parameter : WebControl
    {
        public Parameter() { }

        Parameter(DataBinder parent)
        {
            this._Binder = parent;
        }

        [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public DataBinder Binder
        {
            get { return _Binder; }
            set { _Binder = value; }
        }
        private DataBinder _Binder = null;

        public string Name
        {
            get;
            set;
        }
        public string ControlID
        {
            get;
            set;
        }
        public string PropertyName
        {
            get;
            set;
        }

        public string Type
        {
            get;
            set;
        }
    }

    public class ParameterCollection : CollectionBase
    {
        public int Add(Parameter item)
        {
            return base.List.Add(item);
        }

        public Parameter this[int index]
        {
            get { return (Parameter)base.List[index]; }
        }

        public bool Contains(Parameter item)
        {
            return base.List.Contains(item);
        }
    }
}
